package Tween
{
	import Plugin.TweenObjectPlugin;
	import Plugin.TweenPlugin;
	
	import flash.filters.BitmapFilterQuality;
	import flash.filters.GlowFilter;

	public class GlowTween extends TweenObjectPlugin
	{
		public var startBlurX:Number=0;
		public var startBlurY:Number=0;
		
		public var endBlurX:Number=0;
		public var endBlurY:Number=0;
		
		public var alpha:Number=1;
		public var color:uint=0xFF0000;
		public var inner:Boolean=false;
		public var knockout:Boolean=false;
		public var quality:int=BitmapFilterQuality.LOW;
		public var strength:Number=2;
		
		private var filter:GlowFilter;
		
		public function GlowTween()
		{
			super();
			filter=new GlowFilter();
		}
		
		override protected function _update():void
		{
			if(time==0)return;
			
			var blurX:Number = 0;
			var blurY:Number = 0;
			blurX = easeing(time,startBlurX,endBlurX-startBlurX,duration);
			blurY = easeing(time,startBlurY,endBlurY-startBlurY,duration);
			filter.color=color;
			filter.alpha=alpha;
			filter.blurX=blurX;
			filter.blurY=blurY;
			filter.inner=inner;
			filter.knockout=knockout;
			filter.quality=quality;
			filter.strength=strength;
			go.addFilter(filter);
		}
	}
}